package graph;

public class Test {
    public static void main(String[] args) {
        GraphByMatrix graph=new GraphByMatrix(4,false);
        char[] arr={'A','B','C','D'};
        graph.initArrV(arr);
        graph.addEdge('A','B',1);
        graph.addEdge('A','D',1);
        graph.addEdge('B','A',1);
        graph.addEdge('B','C',1);
        graph.addEdge('C','B',1);
        graph.addEdge('C','D',1);
        graph.addEdge('D','A',1);
        graph.addEdge('D','C',1);
        graph.printGraph();
        System.out.println("---------------------------------");
        System.out.println(graph.getDevOfV('A'));//A的度为2
    }
}
